home *** CD-ROM | disk | FTP | other *** search
/ The Future is Now! / The Future is Now - 17 Demos of New CD-ROM Products (The Locke Groupe, Ltd.)(1992).bin / setup.inf < prev    next >
Text File  |  1992-10-31  |  47KB  |  1,214 lines

  1.  
  2.     ;;*************Begin Title Specific Section***************************
  3.  
  4.     ;;
  5.     ;; SetVariable (Variable, String)
  6.     ;; ------------------------------
  7.     ;; This command sets the variable named 'Variable' to the string
  8.     ;; 'String'.
  9.     ;;
  10.  
  11.     ;;     Change this variable to be the name of the title.
  12.     ;;
  13. SetVariable (TitleName, "The Future is Now")    ; Name of the title
  14.  
  15.     ;;    Change this variable to be the basename of the title's MVB
  16.     ;;    file (i.e. the name of the MVB file without the .MVB 
  17.     ;;    extension).
  18.     ;;
  19. SetVariable (TitleMVB, "EADISC")        ; Basename of the MVB file
  20.  
  21.     ;;    Change this variable to be the subdirectory of the title
  22.     ;;    on the CD-ROM (i.e. where the MVB file is located).  This 
  23.     ;;    subdirectory will be in the Viewer directory on the CD-ROM,
  24.     ;;    where VIEWER.EXE and SETUP.EXE are located.  Do not specify
  25.     ;;    the complete path for this subdirectory.
  26.     ;;
  27. SetVariable (TitleSrcDir, "\EADISC\")    ; Source subdirectory of the title
  28.  
  29.     ;;***************End Title Specific Section***************************
  30.  
  31.     ;;
  32.     ;; GetCurPath (Variable)
  33.     ;; ---------------------
  34.     ;; This command sets the variable 'Variable' to the current path.
  35.     ;; This is the full path of the directory in which SETUP.EXE was 
  36.     ;; started.  A directory name ends in a backslash.
  37.     ;;
  38.  
  39. GetCurPath (ViewerSrcDir)        ; Source directory of the Viewer
  40. SetVariable (ViewerSize, 1 000 000)    ; Size of the Viewer files that will
  41.                     ;  be copied over (measured in bytes)
  42. SetVariable (ViewerDestDir, "C:\VIEWER\")    ; Destination directory for 
  43.                         ;  the Viewer.  Set default
  44.                         ;  here.
  45.  
  46.     ;;
  47.     ;; WindowTitle (Title)
  48.     ;; -------------------
  49.     ;; This command sets the title bar of all subsequent dialog windows to
  50.     ;; the string 'Title'.  The title string must be limited to 127 
  51.     ;; characters.  The title bar can be changed before the first dialog
  52.     ;; window is shown or at any later time using this command.  By 
  53.     ;; default, the title for all dialog windows is "Setup".
  54.     ;;
  55.  
  56. ; Set the title of all dialog windows.
  57. ;
  58. WindowTitle (<TitleName> " Setup")
  59.  
  60.  
  61. ; Set the instruction text used in the initial instructions window.
  62. ; Add Help instructions if the file SETUP.HLP exists.
  63. ;
  64. SetVariable (InitialInstructions, 
  65.     "Click on {\b OK} or press {\b Enter} to continue.  "
  66.     "To abort the setup, click on the {\b Exit} button at the "
  67.     "bottom right corner of the screen, or press {\b F3}.  ")
  68.  
  69.     ;;
  70.     ;; IfFileExistsGoto (FileName, Label)
  71.     ;; ----------------------------------
  72.     ;; This command causes execution to jump to label 'Label' if the
  73.     ;; specified file exists.  This command can be used while the copy
  74.     ;; progress bar is up, but if you do so then you should not check if a
  75.     ;; file exists if that file has been created between the 
  76.     ;; 'OpenCopyProgress' and the 'IfFileExistsGoto'.  The reason for this
  77.     ;; is that 'OpenCopyProgress' will first step through all the copy and
  78.     ;; branching commands until the 'CloseCopyProgress' command without
  79.     ;; actually copying any files.  This is done in order to find the
  80.     ;; range for the copy progress bar.  The 'IfFileExistsGoto' command
  81.     ;; is typically used to see if you are reinstalling files.
  82.     ;;
  83.  
  84. IfFileExistsGoto ("SETUP.HLP", AddHelpInstructions)
  85.  
  86.     ;;
  87.     ;; Goto (Label)
  88.     ;; ------------
  89.     ;; This command will unconditionally cause execution to branch to the
  90.     ;; label 'Label'.
  91.     ;;
  92.  
  93.     Goto (DisplayInitialMessage)
  94. AddHelpInstructions:
  95.     SetVariable (InitialInstructions, 
  96.         <InitialInstructions> "You can always obtain help by "
  97.         "clicking on the {\b Help} button or pressing {\b F1}.  ")
  98.  
  99.     ;;
  100.     ;; DisplayMessage (Text, Instructions)
  101.     ;; -----------------------------------
  102.     ;; This command displays the message 'Text' in a dialog box and the
  103.     ;; instruction text 'Instructions' in the instructions window.  
  104.     ;; A single "OK" default push button at the bottom center of the 
  105.     ;; dialog is used to resume.
  106.     ;;
  107.  
  108. ; Display the initial message.
  109. ;
  110. DisplayInitialMessage:
  111. DisplayMessage (
  112.     "
  113.         
  114.     This Setup program will install:
  115.     
  116.         " <TitleName> "
  117.     
  118.         and the Multimedia Viewer.
  119.         
  120.     
  121.     You will be prompted for the location for the
  122.     Multimedia Viewer. This will require about 1
  123.     Megabyte of disk space.",
  124.     <InitialInstructions>)
  125.  
  126.     ;;
  127.     ;; GetFromWinIni (Variable, Section, Name, Default)
  128.     ;; ------------------------------------------------
  129.     ;; This command reads the WIN.INI file entry 'Name' under the section
  130.     ;; 'Section' and sets the variable 'Variable' to the result.  If the
  131.     ;; specified section or entry were not found, then the specified 
  132.     ;; variable is set to the string 'Default'.
  133.     ;;
  134.  
  135. ; Determine if the Viewer has been installed before.
  136. ; If the WIN.INI file contains information on where the Viewer directory
  137. ; is located, then make that the default path to install the Viewer.
  138. ;
  139. GetFromWinIni (ViewerDestDirTemp, 
  140.     "Multimedia Viewer", "ViewerPath", "Undefined")
  141.  
  142.     ;;
  143.     ;; IfEqualGoto (String1, String2, Label)
  144.     ;; -------------------------------------
  145.     ;; This command will do a case insensitive compare on the strings
  146.     ;; 'String1' and 'String2' and branch to label 'Label' if they match.
  147.     ;;
  148.  
  149. IfEqualGoto (<ViewerDestDirTemp>, "Undefined", PromptViewerDestDir)
  150. SetVariable (ViewerDestDir, <ViewerDestDirTemp>)
  151.  
  152.  
  153. AskAgain:
  154.  
  155.     ;;
  156.     ;; PromptPath (Variable, Default, Message, ValidInstructions,
  157.     ;;        InvalidInstructions)
  158.     ;; ----------------------------------------------------------
  159.     ;; This command causes a dialog box to appear that prompts the user 
  160.     ;; for a path.  The path is a directory that the setup script can use
  161.     ;; to copy into, make, etc.  The message 'Message' is shown at the top
  162.     ;; of the dialog, and the default path is 'Default'.   When PromptPath
  163.     ;; is invoked, Setup checks that the default specified in the INF file
  164.     ;; is a valid path on the user's machine. 
  165.     ;;
  166.     ;; The PromptPath dialog can be in two states.  Whenever the edit box
  167.     ;; contains a valid path, the OK button is available and the 
  168.     ;; 'ValidInstructions' text is displayed in the instruction window.
  169.     ;; Whenever the edit box contains an invalid path, the OK button is
  170.     ;; grayed out and the 'InvalidInstructions' text is displayed in the
  171.     ;; instruction window.
  172.     ;;
  173.     ;; All characters typed in the path edit box appear as upper case no
  174.     ;; matter what the keyboard shift state is in.  When the OK button is
  175.     ;; enabled, the user can click on the OK button or press Enter, upon
  176.     ;; which the path is placed in the variable 'Variable'.  Before
  177.     ;; returning the path however, PromptPath will translate all forward
  178.     ;; slashes to back slashes and ensure that the path ends in a
  179.     ;; back slash.
  180.     ;;
  181.  
  182. ; Ask for where the Multimedia Viewer should be installed.
  183. ;
  184. PromptViewerDestDir:
  185. PromptPath (ViewerDestDir, <ViewerDestDir>,
  186.     "Where should Setup install the Multimedia Viewer?",
  187.     "Modify the default path if necessary, and then click on {\b OK} or "
  188.     "press {\b Enter} to continue.  ",
  189.     "The path is currently not valid.  You must specify a drive "
  190.     "letter, a colon, and a directory from the root of the drive.  ")
  191.  
  192.     ;;
  193.     ;; GetWinPath (Variable)
  194.     ;; ---------------------
  195.     ;; This command sets the variable 'Variable' to the path of the
  196.     ;; Windows directory.  The directory name ends in a backslash.
  197.     ;;
  198.     ;;
  199.  
  200. ; Don't allow Viewer to be installed in the Windows directory
  201. ;
  202. GetWinSystemPath (SystemPath)
  203. GetWinPath (WinPath)
  204. IfNotEqualGoto (<ViewerDestDir>, <WinPath>, CheckSpace)
  205. DisplayMessage (
  206.     "You cannot install the Viewer into the Windows directory.  "
  207.     "Please enter another directory.",
  208.     "Click on {\b OK} or press {\b Enter} to enter another directory "
  209.     "for Viewer.")
  210. Goto (PromptViewerDestDir)
  211.  
  212.     ;;
  213.     ;; GetSpaceAvailable (Variable, Path)
  214.     ;; ----------------------------------
  215.     ;; This command finds the number of bytes available on the disk of 
  216.     ;; the full path 'Path', and sets the variable 'Variable' to the 
  217.     ;; string representation of this value.  The value 0 is returned if
  218.     ;; the specified volume does not exist or cannot be read.
  219.     ;;
  220.  
  221. ; Check if there is enough space to install the Viewer.
  222. ;
  223. CheckSpace:
  224. GetSpaceAvailable (SpaceAvailable, <ViewerDestDir>)
  225.  
  226.     ;;
  227.     ;; IfLowerGoto (Number1, Number2, Label)
  228.     ;; -------------------------------------
  229.     ;; This command will compare 'Number1' and 'Number2', which are 
  230.     ;; strings interpreted as integers.  If 'Number1' is lower than 
  231.     ;; 'Number2' then execution branches to 'Label'.
  232.     ;;
  233.  
  234. IfLowerGoto (<ViewerSize>, <SpaceAvailable>, ViewerDestDirOK)
  235.  
  236.     ;;
  237.     ;; AskYesNo (Variable, Default, Question, Instructions)
  238.     ;; ----------------------------------------------------
  239.     ;; This command displays the string 'Question' in a dialog box and the
  240.     ;; instruction text 'Instructions' in the instruction window.  The
  241.     ;; dialog box has two buttons, labeled "Yes" and "No".  The string
  242.     ;; 'Default' should be either "Yes" or "No" to specify which button is
  243.     ;; the default button.  After a button is pushed, the variable
  244.     ;; 'Variable' is set to the string "Yes" or the string "No" as
  245.     ;; appropriate.
  246.     ;;
  247.  
  248. AskYesNo (Prompt, "Yes",
  249.     "There may not be enough space to install the Multimedia Viewer.  "
  250.     "Would you like to enter a new path for the files?  ",
  251.     "Click on {\b Yes} or press {\b 'Y'} to enter a new path for the "
  252.     "Multimedia Viewer files.\par "
  253.     "Click on {\b No} or press {\b 'N'} to continue anyway.\par "
  254.     "Click on the {\b Exit} button or press {\b F3} to exit Setup.  "
  255.     "You may wish to exit Setup and make some more space on your hard "
  256.     "disk.  Run Setup again when there is enough space on your hard "
  257.     "disk.  ")
  258. IfEqualGoto (<Prompt>, "Yes", PromptViewerDestDir)
  259.  
  260.  
  261. ViewerDestDirOK:
  262. AskYesNo (AskAgain, "No", 
  263.     "Would you like to change anything before proceeding with "
  264.     "the installation?",
  265.     "Click on {\b Yes} or press {\b 'Y'} to reenter options.\par "
  266.     "Click on {\b No} or press {\b 'N'} to proceed with installation.  ")
  267. IfEqualGoto (<AskAgain>, "Yes", AskAgain)
  268.  
  269.     ;;
  270.     ;; MakePath (Path)
  271.     ;; ---------------
  272.     ;; This command causes the path 'Path' to be created if it does not
  273.     ;; already exist.  To make the path, MakePath creates any
  274.     ;; subdirectories that do not already exist.  If the path cannot be
  275.     ;; created, then no error will be reported, as the problem will
  276.     ;; normally be detected when Setup attempts to copy files to this
  277.     ;; path.
  278.     ;;
  279.  
  280. ; Create the tree structure.
  281. ;
  282. MakePath (<ViewerDestDir>)
  283.  
  284.     ;;
  285.     ;; OpenCopyProgress (Message, Instructions)
  286.     ;; ----------------------------------------
  287.     ;; This command begins a file manipulation section.  The command will
  288.     ;; open a progress bar dialog with the message 'Message' and the
  289.     ;; instruction text 'Instructions'.  Following this command, only the
  290.     ;; commands 'SetProgressBarMsg', 'PromptChangeDisk', 'CopyFile',
  291.     ;; 'AppendFile', 'UpdateFile', 'TranslateFile', 'DeleteFile', 
  292.     ;; 'RenameFile', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto', 'ErrorExit',
  293.     ;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', 'Pause', and
  294.     ;; 'MakePath' are allowed until the 'CloseCopyProgress' command is
  295.     ;; reached.  An error is reported and Setup is aborted if any other
  296.     ;; commands are encountered while the progress bar is displayed.
  297.     ;;
  298.  
  299. ; Copy the files
  300. ;
  301. OpenCopyProgress (
  302.     "Setup is copying the Multimedia Viewer runtime files.",
  303.     "Please wait while Setup is copying files.")
  304.  
  305.     ;;
  306.     ;; CopyFile (Source, Destination, Size)
  307.     ;; ------------------------------------
  308.     ;; This command copies the file 'Source' to the file 'Destination'.
  309.     ;; The current disk and directory will be that of the Setup 
  310.     ;; executable.  Normally the files to copy will be in the same place
  311.     ;; (although a volume change may be required---see PromptChangeDisk)
  312.     ;; so a relative path is normally used for the source file name.
  313.     ;; Normally variables are used to specify a complete destination file
  314.     ;; name that depends on the user's path selection.  Any directories 
  315.     ;; specified in the destination path must already exist---they are
  316.     ;; normally created using the MakePath commands. 
  317.     ;;
  318.     ;; The 'Size' field specifies the size of the source file.  In order
  319.     ;; to initialize the progress bar it is necessary to find the total
  320.     ;; number of bytes to copy between the OpenCopyProgress command and
  321.     ;; the CloseCopyProgress command.  Since files may span several disks,
  322.     ;; it would be impractical to obtain this size directly from the 
  323.     ;; source file.  The size field is only required to maintain the
  324.     ;; progress bar, and, although it need not be exact, it should be
  325.     ;; close to reality to maintain the accuracy of the progress bar.
  326.     ;;
  327.     ;; If an error occurs (such as File Not Found, Read Error, Write 
  328.     ;; Error) then an error dialog is shown, at which point the user has
  329.     ;; the option to Abort Setup, Retry the copy operation, or Ignore the
  330.     ;; copy error.  Selecting Abort has the same effect as pressing <F3>. 
  331.     ;; Selecting Retry causes the operation to be retried.  Finally,
  332.     ;; selecting Ignore causes copying to continue despite the error.  The
  333.     ;; latter option will likely result in an incomplete Setup.  The
  334.     ;; command 'IfIncompleteGoto' can be used subsequently to give the 
  335.     ;; user an appropriate message.
  336.     ;;
  337.     ;; Files compressed using the Windows SDK COMPRESS utility will 
  338.     ;; automatically be decompressed as they are being copied to the hard
  339.     ;; disk. 
  340.     ;;
  341.  
  342. CopyFile ("FTENGINE.DLL", <ViewerDestDir> "FTENGINE.DLL",  50000)
  343. CopyFile ("FTUI.DLL",     <ViewerDestDir> "FTUI.DLL",      75000)
  344. CopyFile ("MMP.DLL",      <ViewerDestDir> "MMP.DLL",      200000)
  345. CopyFile ("MVAFF.DLL",    <ViewerDestDir> "MVAFF.DLL",     50000)
  346. CopyFile ("MVAPI.DLL",    <ViewerDestDir> "MVAPI.DLL",     10000)
  347. CopyFile ("MVAUDDLG.DLL", <ViewerDestDir> "MVAUDDLG.DLL",  50000)
  348. CopyFile ("MVAUDIO.DLL",  <ViewerDestDir> "MVAUDIO.DLL",   10000)
  349. CopyFile ("MVBMP.DLL",    <ViewerDestDir> "MVBMP.DLL",     50000)
  350. CopyFile ("QKHOOK.DLL",   <ViewerDestDir> "QKHOOK.DLL",    10000)
  351. CopyFile ("QUICKEYS.EXE", <ViewerDestDir> "QUICKEYS.EXE",  25000)
  352. CopyFile ("QUICKEYS.HLP", <ViewerDestDir> "QUICKEYS.HLP",  25000)
  353. CopyFile ("VIEWER.EXE",   <ViewerDestDir> "VIEWER.EXE",   250000)
  354. CopyFile ("DISPDIB.DLL",  <SystemPath>    "DISPDIB.DLL",   10000)
  355. CopyFile ("VER.DLL",      <SystemPath>    "VER.DLL",       80000)
  356. CopyFile ("AAPLAY.DLL",   <SystemPath>    "AAPLAY.DLL",    20000)
  357. CopyFile ("PAGEDEMO.EXE", <ViewerDestDir> "PAGEDEMO.EXE",  25000)
  358.  
  359.     ;;
  360.     ;; CloseCopyProgress ()
  361.     ;; --------------------
  362.     ;; This command closes the copy progress bar.
  363.     ;;
  364.  
  365. CloseCopyProgress ()
  366.  
  367.     ;;*************Begin Title Specific Section***************************
  368.  
  369. ;;
  370.     ;; OpenProgmanProgress (Message, Instructions)
  371.     ;; -------------------------------------------
  372.     ;; This command begins a Program Manager installation section.
  373.     ;; This command will put up a progress bar with the message 'Message'
  374.     ;; and the instructions 'Instructions'.  Following this command, only
  375.     ;; the commands 'SetProgressBarMsg', 'OpenProgmanGroup', 'ErrorExit',
  376.     ;; 'AddProgmanItem', 'Goto', 'IfEqualGoto', 'IfNotEqualGoto',
  377.     ;; 'IfLowerGoto', 'IfHigherGoto', 'IfFileExistsGoto', and 'Pause' are
  378.     ;; allowed until the 'CloseProgmanProgress' command is reached.  An
  379.     ;; error is reported and Setup is aborted if any other commands are
  380.     ;; encountered while the progress bar is displayed.
  381.     ;;
  382.  
  383. ; Begin adding Progam Manager groups
  384. ;
  385. OpenProgmanProgress (
  386.     "Setup is adding Program Manager groups.",
  387.     "Please wait while Setup adds {\b Program Manager} groups".)
  388.  
  389.     ;;
  390.     ;; OpenProgmanGroup (Group[,  DeleteFlag])
  391.     ;; ---------------------------------------
  392.     ;; This command will set up a DDE conversation with the Program 
  393.     ;; Manager and open the program group entitled 'Group'.  If the 
  394.     ;; optional string 'Delete' is specified and is equal to "Delete", 
  395.     ;; then the specified group will be deleted if it exists, before it is
  396.     ;; created.  Normally this Delete flag is specified to create a new 
  397.     ;; program group, and is omitted to add to an existing group. 
  398.     ;; 
  399.     ;; The progress bar will display the words "Opening" followed by the
  400.     ;; name of the ProgMan group.  If OpenProgmanGroup fails then no error
  401.     ;; is reported.
  402.     ;;
  403.  
  404. ; Add a specific Program Manager group.
  405. ;
  406. OpenProgmanGroup (<TitleName>, Delete)    ;; Add the group named after the title
  407.  
  408.     ;;
  409.     ;; AddProgmanItem (Item, Command, IconFile, IconNumber)
  410.     ;; ----------------------------------------------------
  411.     ;; This command will add a new icon to the Program Manager group 
  412.     ;; opened by OpenProgmanGroup.  The icon will have the title 'Item',
  413.     ;; the command string 'Command', the icon file 'IconFile' and the
  414.     ;; 0-based icon index within the icon file 'IconNumber'.  Variables
  415.     ;; can be used to specify a complete path for the command and icon
  416.     ;; files that are dependent on the user's path choices.
  417.     ;;
  418.     ;; The progress bar will display the words "Adding" followed by the 
  419.     ;; item name.  If AddProgramItem fails then no error is reported.
  420.     ;;
  421.  
  422. AddProgmanItem (<TitleName>,
  423.     <ViewerSrcDir>"EADISC\SEARCH.EXE",<ViewerSrcDir>"EADISC.ICO",0)
  424.  
  425.     ;;
  426.     ;; CloseProgmanProgress ()
  427.     ;; -----------------------
  428.     ;; This command closes the ProgMan DDE conversation.
  429.     ;;
  430.  
  431. CloseProgmanProgress ()
  432.  
  433.  
  434.     ;;
  435.     ;; AddToProfileIni (File, Tag, Name, Value)
  436.     ;; ----------------------------------------
  437.     ;; This command is identical to AddToWinIni, except that any profile
  438.     ;; file can be used.  This can be used to access the SYSTEM.INI file
  439.     ;; and any other private profile files.  No error is reported if this
  440.     ;; operation fails.
  441.     ;;
  442.  
  443. ; Update VIEWER.INI.
  444. ;
  445. AddToProfileIni ("VIEWER.INI", <TitleMVB>, "Path", 
  446.     <ViewerSrcDir> <TitleSrcDir>)
  447. AddToProfileIni ("VIEWER.INI", "Files", <TitleMVB> ".MVB", 
  448.     <ViewerSrcDir> <TitleSrcDir>
  449.     ",Please insert the " <TitleName> " CD in the CD-ROM drive")
  450.  
  451.     ;;    For each of the other books in a multiple-book title, add
  452.     ;;    a VIEWER.INI section that is named after the basename of
  453.     ;;    that book's MVB file (which should be in the same directory
  454.     ;;    as the main title's MVB file).
  455.     ;;
  456. AddToProfileIni ("VIEWER.INI", 
  457.     "EADISC",        ; Basename of the MVB file
  458.     "Path", <ViewerSrcDir> <TitleSrcDir>)
  459.  
  460.     ;;***************End Title Specific Section***************************
  461.  
  462.     ;;
  463.     ;; AddToWinIni (Tag, Name, Value)
  464.     ;; ------------------------------
  465.     ;; This command adds or modifies the WIN.INI file entry 'Name' under
  466.     ;; the tag 'Tag' to equal the string 'Value'.  No error is reported if
  467.     ;; this operation fails.
  468.     ;;
  469.  
  470. ; Update WIN.INI.
  471. ;
  472. AddToWinIni ("Multimedia Viewer", "ViewerPath", <ViewerDestDir>)
  473. AddToWinIni ("Extensions", "mvb", "viewer.exe ^.mvb")
  474.  
  475.  
  476.     ;;
  477.     ;; ModifyAutoexec (Path, Lib, Include, AskInstructions, 
  478.     ;;        ReviewInstructions, SaveInstructions)
  479.     ;; ----------------------------------------------------
  480.     ;; This command ensures that the following environment variables in
  481.     ;; the AUTOEXEC.BAT file are set:
  482.     ;;
  483.     ;;    1. the path 'Path' is present in the PATH variable
  484.     ;;    2. the path 'Lib' is present in the LIB variable
  485.     ;;    3. the path 'Include' is present in the INCLUDE variable
  486.     ;; 
  487.     ;; If any of  'Path', 'Lib', or 'Include' is the null string (""),
  488.     ;; then the corresponding environment variable is ignored.
  489.     ;;
  490.     ;; If an environment variable needs to be changed, a dialog window
  491.     ;; is brought up.  If all the required paths are already in the
  492.     ;; current environment variables, then no dialog is shown.  The
  493.     ;; instruction window contains the instruction text 'AskInstructions'.
  494.     ;;
  495.     ;; If the default option to make the modifications is selected, then
  496.     ;; the old AUTOEXEC.BAT file is saved to AUTOEXEC.BAK and the required
  497.     ;; changes are made to the current AUTOEXEC.BAT file.  Paths are added
  498.     ;; to the beginning of the path list in the PATH, SET LIB, and
  499.     ;; SET INCLUDE statements.   If the statement to set the appropriate
  500.     ;; environment variable is not present then the statement is added to
  501.     ;; the end of the AUTOEXEC.BAT file.  If the AUTOEXEC.BAT file is not
  502.     ;; found, then a new AUTOEXEC.BAT file is created to contain these
  503.     ;; new statements.
  504.     ;;
  505.     ;; If the option to review and edit the changes is chosen then the
  506.     ;; following dialog is shown:
  507.     ;;
  508.     ;; The upper edit box shows the proposed changes to the AUTOEXEC.BAT
  509.     ;; file and the lower edit box shows the current AUTOEXEC.BAT file
  510.     ;; contents.  The instruction window shows the instructon text
  511.     ;; 'ReviewInstructions'.   Any changes made to the upper edit box are
  512.     ;; saved when the user clicks on the OK default button or presses
  513.     ;; <Enter> to save the changes.  The old AUTOEXEC.BAT is saved to the
  514.     ;; file AUTOEXEC.BAK before the changes are made.  The Cancel button
  515.     ;; brings back the previous dialog.
  516.     ;;
  517.     ;; If the option to make the modifications later is chosen then the
  518.     ;; following dialog is shown:
  519.     ;;
  520.     ;; Here the user can specify a file that will contain the
  521.     ;; modifications made to the AUTOEXEC.BAT file.  The instruction
  522.     ;; window shows the instruction text 'SaveInstructions'.  The default
  523.     ;; filename is AUTOEXEC.NEW, but the user can changes this by editing
  524.     ;; the file in the dialog box.  To save the changes to the specified
  525.     ;; file, the user clicks on the Save button or presses 'S' or Enter.
  526.     ;; To not save the changes, the user clicks on the Don't Save button.
  527.     ;; To return to the previous dialog, the user clicks on the Cancel
  528.     ;; button or presses Esc.
  529.     ;;
  530.  
  531. ; Add the Viewer path to the PATH variable in the environment.
  532. ;
  533. ModifyAutoexec (<ViewerDestDir>, "", "",
  534.     "Setup must now make some changes to your {\b AUTOEXEC.BAT} file.  "
  535.     "Click on the desired option and click on {\b OK} to continue.  With "
  536.     "the keyboard, use the arrow keys to select the desired option, and "
  537.     "then press {\b Enter} to continue.\par\par "
  538.     "{\b o} Select the first option to let Setup modify your "
  539.     "AUTOEXEC.BAT file\par "
  540.     "{\b o} Select the second option to view and change the changes "
  541.     "first\par "
  542.     "{\b o} Select the third option if you want to make the changes "
  543.     "yourself later on\par\par ",
  544.     "You can now view the proposed changes to the {\b AUTOEXEC.BAT} "
  545.     "file.  If the changes were not made to your satisfaction, you can "
  546.     "modify the proposed batch file by editing the file in the top "
  547.     "window.  Click on {\b OK} or press {\b Enter} to replace the "
  548.     "current batch file with the proposed one.  To return to the "
  549.     "AUTOEXEC modification options dialog, click on {\b Cancel} or press "
  550.     "{\b Esc}.", 
  551.     "Setup can save the proposed {\b AUTOEXEC.BAT} file to a file that "
  552.     "you specify.  You will have to modify your own {\b AUTOEXEC.BAT} "
  553.     "file yourself and then reboot your computer in order for the Viewer "
  554.     "to function normally.  To return to the AUTOEXEC modification "
  555.     "options dialog, click on {\b Cancel} or press {\b Esc}.")
  556.  
  557. ; Assemble and display finished message
  558.  
  559.     ;;
  560.     ;; IfIncompleteGoto (Label)
  561.     ;; ------------------------
  562.     ;; This command will branch to the label 'Label' if the installation
  563.     ;; was incomplete.  The installation is incomplete if there was an
  564.     ;; error for any file that was copied to the hard disk and the user
  565.     ;; specified to ignore the error.  The installation is also incomplete
  566.     ;; if the 'SetIncomplete' command was executed.
  567.     ;;
  568.  
  569. IfIncompleteGoto (Incomplete)
  570.     SetVariable (Message, 
  571.         "%nThe Setup program has successfully installed%n"
  572.         "the Multimedia Viewer and "<TitleName> ".%n%n")
  573.     Goto (CheckAutoexec)
  574. Incomplete:
  575.     SetVariable (Message,
  576.         "Setup has finished, but the installation was incomplete.  "
  577.         "You should correct any problems (such as insufficient disk "
  578.         "space, missing source files, or locked directories) and run "
  579.         "Setup again.%n%n")
  580.  
  581.  
  582. CheckAutoexec:
  583.  
  584.     ;;
  585.     ;; IfMustModifyGoto (Label)
  586.     ;; ------------------------
  587.     ;; This command will branch to the label 'Label' if Setup had to 
  588.     ;; modify the AUTOEXEC.BAT file, but the user chose to do the
  589.     ;; modifications themselves later.  The command will also branch
  590.     ;; if the 'SetMustModify' command was executed.
  591.     ;;
  592.  
  593. IfMustModifyGoto (MustModify)
  594.  
  595.     ;;
  596.     ;; IfMustRebootGoto (Label)
  597.     ;; ------------------------
  598.     ;; This command will branch to the label 'Label' if Setup has
  599.     ;; modified the AUTOEXEC.BAT file, and the user
  600.     ;; must now reboot the computer.  The command will also branch
  601.     ;; if the 'SetMustReboot' command was executed.
  602.     ;;
  603.  
  604. IfMustRebootGoto (MustReboot)
  605. Goto (End)
  606.  
  607.  
  608. MustModify:
  609.  
  610. SetVariable (Message, 
  611.     <Message> "Remember to modify your AUTOEXEC.BAT file and reboot your "
  612.     "computer before using the Multimedia Viewer.%n%n")
  613. Goto (End)
  614.  
  615.  
  616. MustReboot:
  617.  
  618. SetVariable (Message,
  619.     <Message> "For the changes made by Setup to come into "
  620.     "effect, you must reboot your computer.  To do this, you must first "
  621.     "exit Windows and then simultaneously hold down the Ctrl, Alt, and "
  622.     "Del keys.  You must do this before using the Multimedia Viewer.%n%n")
  623.  
  624.  
  625. End:
  626.  
  627. SetVariable (Message, 
  628.     <Message> "%nThe advantages of being a registered user are numerous.%n"
  629.     "Please send in your Product Registration Card TODAY.")
  630.  
  631. DisplayMessage (<Message>, 
  632.     "Click on {\b OK} or press {\b Enter} to return to the "
  633.     "Program Manager.")
  634.  
  635.  
  636.     ;;
  637.     ;; The following are other commands that Setup recognizes
  638.     ;;
  639.     ;;
  640.     ;; IfNotEqualGoto (String1, String2, Label)
  641.     ;; ----------------------------------------
  642.     ;; This command will do a case insensitive compare on the strings
  643.     ;; 'String1' and 'String2' and branch to 'Label' if they do not match.
  644.     ;;
  645.     ;; IfHigherGoto (Number1, Number2, Label)
  646.     ;; --------------------------------------
  647.     ;; This command will compare 'Number1' and 'Number2', which are
  648.     ;; strings interpreted as long integers.  If 'Number1' is higher 
  649.     ;; than 'Number2' then execution branches to 'Label'.
  650.     ;;
  651.     ;; Add (Variable, Number)
  652.     ;; --------------------------
  653.     ;; This command will add the value 'Number' to the old value of the
  654.     ;; variable 'Variable', and store the result as the new value of
  655.     ;; 'Variable'.  Both the old value of 'Variable' and the string
  656.     ;; 'Number' are interpreted as long integers.
  657.     ;;
  658.     ;; Subtract (Variable, Number)
  659.     ;; -------------------------------
  660.     ;; This command will subtract the value 'Number' from the old value
  661.     ;; of the variable 'Variable', and store the result as the new value
  662.     ;; of 'Variable'.  Both the old value of 'Variable' and the string
  663.     ;; 'Number' are interpreted as long integers.
  664.     ;;
  665.     ;; SetProgressBarMsg (Message)
  666.     ;; ---------------------------
  667.     ;; This command changes the progress bar message to 'Message'.
  668.     ;; This is used to let the user know which group of files is currently
  669.     ;; being copied.
  670.     ;;
  671.     ;; GetWinSystemPath (Variable)
  672.     ;; ---------------------------
  673.     ;; This command sets the variable 'Variable' to the path of the
  674.     ;; Windows System directory.  The directory name ends in a backslash.
  675.     ;;
  676.     ;; Confirm (Variable, Default, Text, Instructions)
  677.     ;; -----------------------------------------------
  678.     ;; This command behaves identically to the AskYesNo command, except
  679.     ;; that it is used to confirm that the options that have been entered
  680.     ;; are correct.  The string 'Text' is normally built from the answers
  681.     ;; to the other prompt commands.
  682.     ;;
  683.     ;; PromptChangeDisk (DiskLabel, File, Instructions)
  684.     ;; ------------------------------------------------
  685.     ;; This command pops up a dialog window requesting the user to insert
  686.     ;; the disk labeled 'DiskLabel' into the current drive.  When the user
  687.     ;; clicks on the "OK" button or presses Enter, Setup checks to see
  688.     ;; that the file with the given name exists.  If the file does not
  689.     ;; exist then Setup assumes that the wrong disk was inserted and the
  690.     ;; dialog remains active.  This is repeated until the file is found,
  691.     ;; at which time the dialog box is removed and execution continues.
  692.     ;;
  693.     ;; UpdateFile (Source, Destination, Size)
  694.     ;; --------------------------------------
  695.     ;; This command is identical to the CopyFile command, except that if
  696.     ;; the destination file exists then it will read the version number
  697.     ;; of the source and the destination files and perform the copy only
  698.     ;; if the version number of the source file is higher than that of the
  699.     ;; destination file.  The source file must not be compressed for this
  700.     ;; to work.
  701.     ;;
  702.     ;; AppendFile (Source, Destination, Size)
  703.     ;; --------------------------------------
  704.     ;; This command is identical to the CopyFile command, except that the
  705.     ;; source file is appended to the destination file.  This command is 
  706.     ;; useful for copying files that span several volumes.
  707.     ;;
  708.     ;; Files compressed using the Windows SDK COMPRESS utility will
  709.     ;; automatically be decompressed as they are being copied to the hard
  710.     ;; disk. 
  711.     ;;
  712.     ;; TranslateFile (Source, Destination, Size, Tag1, Replacement1, 
  713.     ;;         Tag2, Replacement2, ...)
  714.     ;; -------------------------------------------------------------
  715.     ;; The TranslateFile command behaves just like the CopyFile command,
  716.     ;; except that all strings enclosed in double angle brackets (<<...>>)
  717.     ;; in the source file are treated as "tags" which, together with the
  718.     ;; angle brackets, get replaced by the corresponding replacement
  719.     ;; strings in the destination file.
  720.     ;;
  721.     ;; For instance, if the source file "SOURCE.BAT" contains the line
  722.     ;;
  723.     ;;     set WinDir=<<WinDir>>
  724.     ;;
  725.     ;; and the following commands are used to copy the file
  726.     ;;
  727.     ;;    GetWinPath (WindowsDir)
  728.     ;;    .
  729.     ;;    .
  730.     ;;    TranslateFile ("SOURCE.BAT", "DEST.BAT", 1000, 
  731.     ;;        "WinDir", <WindowsDir>)
  732.     ;;
  733.     ;; then the file "DEST.BAT" will contain the following line:
  734.     ;;
  735.     ;;    set WinDir=C:\WIN
  736.     ;;
  737.     ;; The tag can be up to 127 characters long.  If the tag is not listed
  738.     ;; with its replacement string then the tag and its angle brackets
  739.     ;; will not be present in the destination file.
  740.     ;;
  741.     ;; The source file can be compressed.  This command is not 
  742.     ;; particularly fast, so it is only suited for short files, like INI
  743.     ;; files and BAT files.
  744.     ;;
  745.     ;; RenameFile (CurrentName, NewName)
  746.     ;; ---------------------------------
  747.     ;; This command renames the file specified by 'CurrentName' to
  748.     ;; 'NewName'.  No error is reported if this command fails.
  749.     ;;
  750.     ;; DeleteFile (FileName)
  751.     ;; ---------------------
  752.     ;; This command deletes the file specified by 'FileName', if this
  753.     ;; file exists.  No error is reported if this command fails.
  754.     ;;
  755.     ;; GetFromProfileIni (Variable, File, Tag, Name, Default)
  756.     ;; ------------------------------------------------------
  757.     ;; This command is identical to GetFromWinIni except that any profile
  758.     ;; file can be used.
  759.     ;;
  760.     ;; Pause (Time)
  761.     ;; ------------
  762.     ;; This command will pause execution in the script file for the
  763.     ;; specified number of milliseconds.  This command can be used when
  764.     ;; copying files or modifying the Program Manager groups in order to
  765.     ;; give the user time to see what is happening.
  766.     ;;
  767.     ;; Execute (CommandString, DisplayType)
  768.     ;; ------------------------------------
  769.     ;; This command will launch the program specified in the string
  770.     ;; 'CommandString'.  Parameters can appear following the program name.
  771.     ;; The argument 'DisplayType' determines whether the program window is
  772.     ;; shown as hidden, normal, minimized, or maximized, as specified in
  773.     ;; the following table:
  774.     ;;
  775.     ;;    'DisplayType'                Effect
  776.     ;;        0            Window appears hidden
  777.     ;;        1            Window appears normal
  778.     ;;        2            Window appears minimized
  779.     ;;        3            Window appears maximized
  780.     ;;
  781.     ;; ErrorExit (Text)
  782.     ;; ---------------------
  783.     ;; This command forces Setup to exit after a fatal error.  A message
  784.     ;; box pops up with the message 'Text' explaining the error, and then
  785.     ;; Setup ends.
  786.     ;;
  787.     ;; SendWinIniChange (Section)
  788.     ;; --------------------------
  789.     ;; This command broadcasts a WM_WININICHANGE message to all top-level
  790.     ;; windows when changes have been made to the section 'Section' in
  791.     ;; the Windows initialization file, WIN.INI.  The section name does
  792.     ;; not include the square brackets.
  793.     ;;
  794.     ;; SendDevModeChange (Device)
  795.     ;; --------------------------
  796.     ;; This command broadcasts a WM_DEVMODECHANGE message to all top-level
  797.     ;; windows when changes have been made to the device-mode settings
  798.     ;; of the device 'Device'.
  799.     ;;
  800.     ;; ParseField (Variable, String, FieldPosition)
  801.     ;; --------------------------------------------
  802.     ;; This command sets the variable 'Variable' to be the field specified
  803.     ;; by the number 'FieldPosition' in the string 'String'.  Fields are
  804.     ;; separated by commas.  The first field in a string is in position 1.
  805.     ;; If the field position is out of bounds, or there is some other
  806.     ;; kind of error, then 'Variable' is set to an empty string.
  807.     ;;
  808.     ;; For example, 
  809.     ;;
  810.     ;;    ParseField (Var1, "Position 1, Position 2", 2)
  811.     ;;
  812.     ;; would set the variable 'Var1' to be "Position 2".
  813.     ;;
  814.     ;; MidString (Variable, String, StartPos, Span)
  815.     ;; --------------------------------------------
  816.     ;; This command sets the variable 'Variable' to be a substring of the
  817.     ;; string 'String'.  The substring starts at position 'StartPos' in
  818.     ;; the source string (which is 0-based) and is 'Span' characters long.
  819.     ;; If there are not enough characters in the string at position
  820.     ;; 'StartPos' to form the substring, then as many characters as
  821.     ;; possible will be formed from that position onward.  If 'StartPos'
  822.     ;; is not within the string, a fatal error will result.
  823.     ;;
  824.     ;; OpenMessageBox (Text, Instructions)
  825.     ;; -----------------------------------
  826.     ;; This command displays the message 'Text' in a dialog box and the
  827.     ;; instruction text 'Instructions' in the instructions window.
  828.     ;; The dialog box remains until a 'CloseMessageBox' command is
  829.     ;; issued.  Other commands can occur in the setup script between the
  830.     ;; 'OpenMessageBox' and 'CloseMessageBox' commands.
  831.     ;;
  832.     ;; CloseMessageBox ()
  833.     ;; ------------------
  834.     ;; This command closes a dialog box that was opened with the
  835.     ;; 'OpenMessageBox' command.
  836.     ;;
  837.     ;; FileErrorBox (Variable, Message, File)
  838.     ;; --------------------------------------
  839.     ;; This command puts up a dialog to handle file errors.  The dialog
  840.     ;; box contains three buttons: Abort, Retry, and Ignore.  Retry is
  841.     ;; the default button.  The box contains an error message 'Message'
  842.     ;; followed by the file 'File' that is in question.
  843.     ;;
  844.     ;; If the Ignore button is pressed, the variable 'Variable' is set to
  845.     ;; the string "Ignore".  If the Retry button is pressed, 'Variable' is
  846.     ;; set to "Retry".  If the Abort button is pressed, a dialog box will
  847.     ;; ask if the user wants to end Setup.  If the user chooses Yes, then
  848.     ;; Setup will end.  If the user chooses No, then 'Variable' is set
  849.     ;; to "Retry".
  850.     ;;
  851.     ;; SetIncomplete ()
  852.     ;; ----------------
  853.     ;; This command indicates that the installation was incomplete, 
  854.     ;; causing the 'IfIncompleteGoto' command to branch to the label
  855.     ;; in its argument list.
  856.     ;;
  857.     ;; SetMustModify ()
  858.     ;; ----------------
  859.     ;; This command indicates that Setup had to modify the AUTOEXEC.BAT 
  860.     ;; file, but the user chose to do the modifications later.  This will
  861.     ;; cause the 'IfMustModifyGoto' command to branch to the label
  862.     ;; in its argument list.
  863.     ;;
  864.     ;; SetMustReboot ()
  865.     ;; ----------------
  866.     ;; This command indicates that Setup has altered the system so that
  867.     ;; the user must reboot the computer for these changes to come into
  868.     ;; effect.  This will cause the 'IfMustRebootGoto' command to branch
  869.     ;; to the label in its argument list.
  870.     ;;
  871.     ;; EnumerateWinIni (Variable, Section)
  872.     ;; -----------------------------------
  873.     ;; This command enumerates the key names associated with the section
  874.     ;; 'Section' of WIN.INI.  The key names will be separated by commas,
  875.     ;; and will be stored in the variable 'Variable'.  If 'Section' does
  876.     ;; not exist, or there is some other error, then 'Variable' will be
  877.     ;; set to the empty string.  Do not specify the brackets '[' and ']'
  878.     ;; in 'Section'.
  879.     ;;
  880.     ;; EnumerateProfileIni (Variable, File, Section)
  881.     ;; ---------------------------------------------
  882.     ;; This command is identical to 'EnumerateWinIni' except that it 
  883.     ;; operates on any initialization file specified by the name 'File'.
  884.     ;;
  885.  
  886.     ;;
  887.     ;; Subroutines
  888.     ;; -----------
  889.     ;; Subroutines can be implemented in the Setup script using the 
  890.     ;; mechanism described as follows (an example subroutine call is 
  891.     ;; provided for the installation of PostScript fonts).
  892.     ;;
  893.     ;; A subroutine may require various input and output variables.  The
  894.     ;; input variables should be set before calling the subroutine.  These
  895.     ;; variables may be altered within the subroutine; do not expect them
  896.     ;; to remain constant.  After the subroutine returns, the output 
  897.     ;; variables contain the output values.  A special variable,
  898.     ;; 'Continuation', must also be set to contain the label at which
  899.     ;; the execution resumes after the subroutine returns.  Normally,
  900.     ;; this label will be immediately after the subroutine call.  The
  901.     ;; subroutine call itself is made by a 'Goto' statement to the 
  902.     ;; subroutine's entry label.
  903.     ;;
  904.     ;;    NOTE: All variables are global!
  905.     ;;
  906.     ;; The code for a subroutine requires certain statements.  The
  907.     ;; first statement should be a 'Goto' statement that skips over
  908.     ;; the entire subroutine so that it will only be activated if it is 
  909.     ;; explicitly called.  Thus, the last statement of the subroutine
  910.     ;; should be a label to which the first 'Goto' jumps to.  The second
  911.     ;; statement in the subroutine should be the entry label of the
  912.     ;; subroutine.  The next to last statement of the subroutine should
  913.     ;; be the statement 'Goto (<Continuation>)', which allows the 
  914.     ;; subroutine to return.  For the example PostScript font installation
  915.     ;; subroutine, the first and last lines are as follows:
  916.     ;;
  917.     ;;
  918.     ;;        Goto (subInstallPSFontEnd)
  919.     ;;        subInstallPSFont:
  920.     ;;        ;
  921.     ;;        ; {body of the subroutine}
  922.     ;;        ;
  923.     ;;        Goto (<Continuation>)
  924.     ;;        subInstallPSFontEnd:
  925.     ;;
  926.     ;;
  927.  
  928.     ;;
  929.     ;; Subroutine Code: subInstallPSFont
  930.     ;; ---------------------------------
  931.     ;; This subroutine installs PostScript fonts which consist of a
  932.     ;; Windows font metric table file (.PFM) and a PostScript font file
  933.     ;; (.PFA) for each font.
  934.     ;;
  935.     ;; Subroutine entry label:
  936.     ;;    subInstallPSFont
  937.     ;; Input variables:
  938.     ;;    MetricBase - base name of the Windows font metric table file
  939.     ;;    FontBase - base name of the PostScript font file
  940.     ;;    MetricPath - full pathname of metric file
  941.     ;;    FontPath - full pathname of font file
  942.     ;; Output variables:
  943.     ;;    (none)
  944.     ;; Continuation variable:
  945.     ;;    Continuation
  946.     ;;
  947.  
  948.     ;; Skip over the subInstallPSFont subroutine.  It will be activated
  949.     ;; only if it is explicitly "called".
  950.     ;;
  951. Goto (subInstallPSFontEnd)    
  952.  
  953.     ;; Begin the subInstallPSFont subroutine.
  954.     ;;
  955. subInstallPSFont:
  956.  
  957.     ; Local constant: Printer name.  Used in dialog boxes.
  958.     ;
  959. SetVariable (ipfPrinterName, "PostScript")
  960.  
  961.     ; Local constant: Subroutine name.  Used in error dialog boxes.
  962.     ;
  963. SetVariable (ipfSubroutineName, "subInstallPSFont")
  964.  
  965.     ; Local constant: Printer driver.  Basename of the driver for which
  966.     ; we are installing fonts.
  967.     ;
  968. SetVariable (ipfDriver, "PSCRIPT")
  969.  
  970.     ; Local constant: Destination directory for the metric and
  971.     ; font files.  We will put them into the Windows system directory.
  972.     ;
  973. GetWinSystemPath (ipfSystemPath)
  974.  
  975.  
  976. OpenMessageBox (
  977.     "Setup is installing the " <ipfPrinterName> " font consisting of "
  978.     <MetricBase> " and " <FontBase> ".",
  979.     "Please wait while Setup installs " <ipfPrinterName> " fonts.")
  980.  
  981.  
  982.     ; Check if the metric and font files exist.
  983.     ;
  984. ipfCheckMetricPath:
  985. IfFileExistsGoto (<MetricPath>, ipfMetricExists)
  986.     FileErrorBox (ipfTmp , "The following file was not found:", 
  987.         <MetricPath>)
  988.     IfEqualGoto (<ipfTmp>, "Retry", ipfCheckMetricPath)
  989.     SetIncomplete ()
  990.     Goto (ipfFinished)
  991. ipfMetricExists:
  992.  
  993. ipfCheckFontPath:
  994. IfFileExistsGoto (<FontPath>, ipfFontExists)
  995.     FileErrorBox (ipfTmp , "The following file was not found:", 
  996.         <FontPath>)
  997.     IfEqualGoto (<ipfTmp>, "Retry", ipfCheckFontPath)
  998.     SetIncomplete ()
  999.     Goto (ipfFinished)
  1000. ipfFontExists:
  1001.  
  1002.  
  1003.     ; Enumerate the different printers.  This information is found in the
  1004.     ; 'PrinterPorts' section of WIN.INI.
  1005.     ;
  1006. EnumerateWinIni (ipfPrinterPorts, "PrinterPorts")
  1007. IfNotEqualGoto (<ipfPrinterPorts>, "", ipfPrinterPortsOK)
  1008.     DisplayMessage (<ipfSubroutineName> ": "
  1009.         "There are no printers installed.%n%n"
  1010.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1011.         " and " <FontBase> " was not installed.",
  1012.         "")
  1013.     SetIncomplete ()
  1014.     Goto (ipfFinished)
  1015. ipfPrinterPortsOK:
  1016.  
  1017.  
  1018.     ; For each printer in the 'PrinterPorts' section, find out its
  1019.     ; associated printer information.  For example, ipfPrinterInfo might
  1020.     ; be "PSCRIPT,LPT2:,15,45,COM2:,15,45".  If the first field in the
  1021.     ; printer information matches the desired printer driver (ipfDriver),
  1022.     ; then install the fonts for each printer listed in the printer 
  1023.     ; information.
  1024.     ;
  1025. SetVariable (ipfPortIndex, 1)
  1026. ipfPortLoop:
  1027. ParseField (ipfPrinter, <ipfPrinterPorts>, <ipfPortIndex>)
  1028.     IfEqualGoto (<ipfPrinter>, "", ipfFinished)    ; End port loop
  1029. GetFromWinIni (ipfPrinterInfo, "PrinterPorts", <ipfPrinter>, "NONE")
  1030. IfNotEqualGoto (<ipfPrinterInfo>, "NONE", ipfPrinterInfoOK)
  1031.     DisplayMessage (<ipfSubroutineName> ": "
  1032.         "There was an error reading the '" <ipfPrinter> "' entry in "
  1033.         "the 'PrinterPorts' section of WIN.INI.%n%n",
  1034.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1035.         " and " <FontBase> " may not be completely installed.",
  1036.         "")
  1037.     SetIncomplete ()
  1038.     Goto (ipfPortInc)
  1039. ipfPrinterInfoOK:
  1040. ParseField (ipfDrv, <ipfPrinterInfo>, 1)
  1041. IfEqualGoto (<ipfDrv>, <ipfDriver>, ipfInstall)
  1042. ipfPortInc:
  1043. Add (ipfPortIndex, 1)
  1044. Goto (ipfPortLoop)
  1045.  
  1046.  
  1047. ipfInstall:
  1048.     ; Install the font for each PostScript printer
  1049.     ;
  1050. SetVariable (ipfIndex, 2)
  1051. ipfInstallLoop:
  1052. ParseField (ipfPrinterField, <ipfPrinterInfo>, <ipfIndex>)
  1053.     IfEqualGoto (<ipfPrinterField>, "", ipfPortInc)        ; End loop
  1054. MidString (ipfPort, <ipfPrinterField>, 0, 4)    ; Assume port names are 4
  1055.                         ; characters long
  1056. IfNotEqualGoto (<ipfPort>, "", ipfPortOK)
  1057.     DisplayMessage (<ipfSubroutineName> ": "
  1058.         "The WIN.INI file is defective.%n%n"
  1059.         "The " <ipfPrinterName> " font consisting of " <MetricBase> 
  1060.         " and " <FontBase> " may not be completely installed.",
  1061.         "")
  1062.     SetIncomplete ()
  1063.     Goto (ipfInstallInc)
  1064. ipfPortOK:
  1065. SetVariable (ppfContinuation, ipfInstallInc)
  1066. Goto (subPrinterPSFont)
  1067. ipfInstallInc:
  1068. Add (ipfIndex, 3)
  1069. Goto (ipfInstallLoop)
  1070.  
  1071.  
  1072. ipfFinished:
  1073. CloseMessageBox ()
  1074.     ; Return from subroutine
  1075.     ;
  1076. Goto (<Continuation>)
  1077.  
  1078.  
  1079.     ;; End of subInstallPSFont subroutine
  1080.     ;;
  1081. subInstallPSFontEnd:
  1082.  
  1083.  
  1084.     ;;
  1085.     ;; Subroutine Code: subPrinterPSFont
  1086.     ;; ---------------------------------
  1087.     ;; This subroutine installs PostScript fonts for each PostScript
  1088.     ;; printer that is installed.  Each printer is identified by its
  1089.     ;; printer port (e.g. "LPT2").  This subroutine is called by the
  1090.     ;; subInstallPSFont subroutine.
  1091.     ;;
  1092.     ;; Subroutine entry label:
  1093.     ;;    subPrinterPSFont
  1094.     ;; Input variables:
  1095.     ;;    MetricBase - base name of the Windows font metric table file
  1096.     ;;    FontBase - base name of the PostScript font file
  1097.     ;;    MetricPath - full pathname of metric file
  1098.     ;;    FontPath - full pathname of font file
  1099.     ;;    ipfPort - printer port for the particular PostScript printer
  1100.     ;;    ipfSystemPath - destination directory for the metric and font
  1101.     ;;        files
  1102.     ;;    ipfPrinter - printer type
  1103.     ;; Output variables:
  1104.     ;;    (none)
  1105.     ;; Continuation variable:
  1106.     ;;    ppfContinuation
  1107.     ;;
  1108.  
  1109.     ;; Skip over the subPrinterPSFont subroutine.  It will be activated
  1110.     ;; only if it is explicitly "called".
  1111.     ;;
  1112. Goto (subPrinterPSFontEnd)
  1113.  
  1114.     ;; Begin the subPrinterPSFont subroutine.
  1115.     ;;
  1116. subPrinterPSFont:
  1117.  
  1118.  
  1119.     ; Local constant: Prefix for the WIN.INI section of this particular
  1120.     ; printer.
  1121.     ;
  1122. SetVariable (ppfPrefix, "PostScript,")
  1123.  
  1124.  
  1125.     ; Determine the destination paths of the metric and font files.
  1126.     ;
  1127. SetVariable (ppfMetricDest, <ipfSystemPath> <MetricBase>)
  1128. SetVariable (ppfFontDest, <ipfSystemPath> <FontBase>)
  1129.  
  1130.  
  1131.     ; Determine the value to store in the WIN.INI entry
  1132.     ;
  1133. SetVariable (ppfValue, <ppfMetricDest> "," <ppfFontDest>)
  1134.  
  1135.  
  1136.     ; Determine the section name of the printer, which is the section 
  1137.     ; prefix and the printer port separated by a comma.
  1138.     ;
  1139.     ; For example, Section may be "PostScript,LPT2" for a PostScript 
  1140.     ; printer connected to printer port #2.
  1141.     ;
  1142. SetVariable (ppfSection, <ppfPrefix> <ipfPort>)
  1143.  
  1144.  
  1145.     ; Determine the number of soft fonts already installed.
  1146.     ;
  1147. GetFromWinIni (ppfSoftFonts, <ppfSection>, "softfonts", 0)
  1148.  
  1149.  
  1150.     ; Check if the metric file or the font file has already been 
  1151.     ; installed.  The softfont index (ppfIndex) and the number of 
  1152.     ; softfonts encountered (ppfCount) may not be the same since the
  1153.     ; softfonts may not be numbered consecutively.
  1154.     ;
  1155. SetVariable (ppfIndex, 1)    ; softfont index
  1156. SetVariable (ppfCount, 1)    ; number of softfonts encountered
  1157. ppfCheckLoop:
  1158. IfHigherGoto (<ppfCount>, <ppfSoftFonts>, ppfLook)
  1159. GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfIndex>, "NONE")
  1160. IfEqualGoto (<ppfFontEntry>, "NONE", ppfCheckInc)    ; non-consecutive
  1161. IfEqualGoto (<ppfFontEntry>, <ppfValue>, ppfFinished)    ; already installed
  1162. Add (ppfCount, 1)
  1163. ppfCheckInc:
  1164. Add (ppfIndex, 1)
  1165. Goto (ppfCheckLoop)
  1166.  
  1167.  
  1168. ppfLook:
  1169.     ; Look for the first empty slot to put in the new softfont entry
  1170.     ;
  1171. SetVariable (ppfLookIndex, 1)
  1172. ppfLookLoop:
  1173. IfHigherGoto (<ppfLookIndex>, <ppfSoftFonts>, ppfInstall)
  1174. GetFromWinIni(ppfFontEntry, <ppfSection>, "softfont" <ppfLookIndex>, "NONE")
  1175. IfEqualGoto (<ppfFontEntry>, "NONE", ppfInstall)
  1176. ppfLookInc:
  1177. Add (ppfLookIndex, 1)
  1178. Goto (ppfLookLoop)
  1179.  
  1180.  
  1181. ppfInstall:
  1182.     ; Update the softfont fields in the WIN.INI file.
  1183.     ; Notify Windows that the WIN.INI file has changed.
  1184.     ;
  1185. Add (ppfSoftFonts, 1)
  1186. AddToWinIni (<ppfSection>, "softfonts", <ppfSoftFonts>)
  1187. AddToWinIni (<ppfSection>, "softfont" <ppfLookIndex>, <ppfValue>)
  1188. SendWinIniChange (<ppfSection>)
  1189.  
  1190.  
  1191. ppfFinished:
  1192.     ; Copy the metric and font files.  Do this in all cases since the
  1193.     ; metric and font files may have changed, although their names
  1194.     ; have not.
  1195.     ;
  1196. CopyFile (<MetricPath>, <ppfMetricDest>, 1)
  1197. CopyFile (<FontPath>, <ppfFontDest>, 1)
  1198.  
  1199.  
  1200.     ; Notify Windows that the font files for the printer driver have
  1201.     ; changed.
  1202.     ;
  1203. SendDevModeChange (<ipfPrinter>)
  1204.  
  1205.  
  1206.     ; Return from subroutine
  1207.     ;
  1208. Goto (<ppfContinuation>)
  1209.  
  1210.     ;; End of subPrinterPSFont subroutine
  1211.     ;;
  1212. subPrinterPSFontEnd:
  1213. 
  1214.